package com.ruoyi.web.controller.statistics.college;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.college.Statistics.PrizeVO;
import com.ruoyi.system.domain.college.Statistics.TeamVO;
import com.ruoyi.system.domain.college.Statistics.UniversityStatDTO;
import com.ruoyi.system.domain.teacher.Statistics.TeacherStatisticsRequestVO;
import com.ruoyi.system.service.college.ICollegeStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Description: 学院统计
 * @Author: liuwei
 * @Date: 2025/1/27 10:00
 */
@RestController
@RequestMapping("/college/statistics")
public class CollegeStatisticsController extends BaseController {
    @Autowired
    private ICollegeStatisticsService collegeStatisticsService;

    /**
     * 查询个人荣誉列表
     * 院长界面底部区域统计数量
     */
    @GetMapping("/list")
    public AjaxResult list(TeacherStatisticsRequestVO requestVO) {
        return success(collegeStatisticsService.getList(requestVO));
    }

    /**
     * 师资力量
     * 师资队伍建设质量
     */
    @GetMapping("/team")
    public List<TeamVO> team() {
        return collegeStatisticsService.statisticTeam();
    }

    /**
     * 课程资源
     * 统计学历人数
     */
    @GetMapping("/education")
    public  List<UniversityStatDTO> education() {
        return collegeStatisticsService.statisticEducation();
    }
    /**
     * 课程资源
     * 根据传入的部门id查询有多少人
     * @param deptId
     * @return
     */
    @GetMapping("/course")
    public AjaxResult course(TeacherStatisticsRequestVO requestVO) {
        return success(collegeStatisticsService.statisticPerson(requestVO));
    }

    /**
     * 获取首页各项信息
     * @return
     */
    @PostMapping("/indexInfo")
    public AjaxResult getIndexInfo(TeacherStatisticsRequestVO requestVO){
        Long deptId = SecurityUtils.getLoginUser().getUser().getDeptId();
        requestVO.setDeptId(deptId+"");
        return   success(collegeStatisticsService.getIndexInfo(requestVO));
    }
    /**
     * 获取学院概览信息 教师人数 团队荣誉
     * @return
     */
    @GetMapping("/overview")
    public AjaxResult overview(TeacherStatisticsRequestVO requestVO){
        return   success(collegeStatisticsService.overview(requestVO));
    }
}
